package models;
import java.util.Date;
import javax.persistence.Entity;
import play.db.jpa.Model;
import utils.Security;
import constants.Constants;
import play.data.binding.As;
import javax.persistence.Transient;
/**
 * ${model.comment}表 ${model.tableName}
 * 
 * @author ${model.author}
 * @date ${date}
 */
@Entity
public class ${model.tableName} extends Model{ 
	
#foreach ($field in $fieldList)
#if(${field.field}!="id")
#if(${field.inputType}=="datetime")
/** ${field.comment} */
	@As("yyyy-MM-dd HH:mm:ss")
	public ${field.type} ${field.columnName};
#elseif(${field.inputType}=="date")
/** ${field.comment} */
	@As("yyyy-MM-dd")
	public ${field.type} ${field.columnName};
#else
	/** ${field.comment} */
	public ${field.type} ${field.columnName};
#end
#end
#end

	@Transient
	public String sign;//加密ID
	@Transient
	public String sign2;//不带时间戳的加密ID
	
	public String getSign() {
		return Security.addSign(this.id, Constants.SUPERVISOR_ID_SIGN);
	}
	
	/**
	 * 在添加客服中用到
	 */
	public String getSign2() {
		return scdz.security.Encrypt.encrypt3DES(this.id + "", Constants.SUPERVISOR_ID_SIGN);
	}
}
